package main.app.view.screens
{
	import feathers.controls.Button;
	import feathers.controls.Header;
	import feathers.controls.Screen;
	import feathers.events.FeathersEventType;
	
	import starling.events.Event;
	
	public class RegisterMenu extends Screen
	{
		
		private var _header:Header;
		private var _returnButtion:Button;
		
		
		override protected function initialize():void
		{
			_header = new Header();
			_header.title = "注册界面";
			addChild(_header);
			
			_returnButtion = new Button();
			_returnButtion.label = "返回"
			_returnButtion.addEventListener(Event.TRIGGERED,__returnLoginMenu)
			addChild(_returnButtion);
		}
		
		private function __returnLoginMenu(evt:Event):void
		{
			dispatchEventWith( ScreenEvents.SHOW_LOGIN_MENU);  
		}
		
		override protected function draw():void
		{
			this._header.width = this.actualWidth;
			this._header.validate();	
		}
		
		//清理函数，很重要
		override protected function screen_removedFromStageHandler(event:Event):void
		{
			this.removeChildren(0,-1,true);
		}
	}
}